<?php
namespace app\api\controller;
use think\Controller;
use app\api\model\Advice as Advices;
/**
 * 
 * @author sj
 *投诉建议
 */
class Advice extends Controller{
    private static $AdviceModel;
    public function __construct(){
        if(!self::$AdviceModel instanceof self){
            self::$AdviceModel=new Advices();
        }
    }
    public function index(){
        if(request()->isGet()){
            return view('advise/advise');
        }else{
            $post_data=input('post.');
            $res=self::$AdviceModel->post($post_data);
            if($res){
                ajaxReturn2(1,'提交成功','');
            }else{
                ajaxReturn2(0,'提交失败',$post_data);
            }
        }
    }
}